Skip to content

Conversation

@Sathyvs
Copy link
Contributor

@Sathyvs Sathyvs commented Jan 17, 2026

Changes related to PushNotificationConfig pagination feature

Description

Addresses PR comments from PR 564

Fixes #553 🦕

…ted to PushNotificationConfig pagination feature
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Sathyvs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the PushNotificationConfig pagination functionality by making the maximum page size configurable and improving the robustness of page token validation. It also includes a minor adjustment to a core dependency's scope and introduces a flexible way to manage default configurations in test environments. These changes collectively improve the maintainability, configurability, and error handling of the pagination feature.

Highlights

  • Configurable Max Page Size: Introduced a configurable maximum page size for push notification configuration listings, defaulting to 100 and allowing overrides via the a2a.push-notification-config.max-page-size property.
  • Improved Invalid Page Token Handling: The system now explicitly throws an InvalidParamsError when an invalid pageToken format is provided, instead of silently ignoring it and starting from the beginning.
  • Dependency Scope Adjustment: The quarkus-arc dependency in server-common was promoted from test scope to a compile-time dependency, indicating its broader usage within the application.
  • Test-Specific Default Configuration: A mechanism was added to allow overriding default configuration properties specifically for testing environments, using the a2a.defaults.resource property.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses previous review comments by refactoring the pagination logic in JpaDatabasePushNotificationConfigStore to be cleaner and more robust. Key improvements include making the maximum page size configurable, validating page tokens more strictly, and updating tests to cover these changes. The code is well-structured, and the new test cases are thorough. I have a couple of suggestions to improve exception handling and code style.

Comment on lines +58 to +62
} catch (Exception e) {
LOGGER.warn("Failed to read '{}' configuration, falling back to default page size of {}.",
A2A_PUSH_NOTIFICATION_MAX_PAGE_SIZE_CONFIG, A2A_PUSH_NOTIFICATION_DEFAULT_MAX_PAGE_SIZE, e);
maxPageSize = A2A_PUSH_NOTIFICATION_DEFAULT_MAX_PAGE_SIZE;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Catching the generic Exception is overly broad and can hide other unexpected issues. It's better to catch the specific exceptions you expect, such as IllegalArgumentException (if the config value is missing from the provider) and NumberFormatException (if the value is not a valid integer). This makes the error handling more precise and robust.

Suggested change
} catch (Exception e) {
LOGGER.warn("Failed to read '{}' configuration, falling back to default page size of {}.",
A2A_PUSH_NOTIFICATION_MAX_PAGE_SIZE_CONFIG, A2A_PUSH_NOTIFICATION_DEFAULT_MAX_PAGE_SIZE, e);
maxPageSize = A2A_PUSH_NOTIFICATION_DEFAULT_MAX_PAGE_SIZE;
}
} catch (IllegalArgumentException | NumberFormatException e) {
LOGGER.warn("Failed to read or parse '{}' configuration, falling back to default page size of {}.",
A2A_PUSH_NOTIFICATION_MAX_PAGE_SIZE_CONFIG, A2A_PUSH_NOTIFICATION_DEFAULT_MAX_PAGE_SIZE, e);
maxPageSize = A2A_PUSH_NOTIFICATION_DEFAULT_MAX_PAGE_SIZE;
}

"Should have nextPageToken since more configs remain");

// Verify we can iterate through all pages and get all 7 configs
List<String> allConfigIds = new java.util.ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fully qualified name java.util.ArrayList is used here. It would be more conventional to import java.util.ArrayList at the top of the file and use the short name new ArrayList<>(). This improves readability. A similar simplification can be applied to new java.util.HashSet<>() on line 589 by importing java.util.HashSet.

Suggested change
List<String> allConfigIds = new java.util.ArrayList<>();
List<String> allConfigIds = new ArrayList<>();

@Sathyvs
Copy link
Contributor Author

Sathyvs commented Jan 17, 2026

@kabir @ehsavoie a quick review pls ?

@Sathyvs Sathyvs marked this pull request as ready for review January 17, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Use Jpa to paginate in JpaDatabasePushNotificationConfigStore

1 participant